############################################################################
# Copyright (c) 2016, Johan Mabille and Sylvain Corlay                     #
# xtensor-fftw: Copyright (c) 2017, Patrick Bos                            #
#                                                                          #
# Distributed under the terms of the BSD 3-Clause License.                 #
#                                                                          #
# The full license is in the file LICENSE, distributed with this software. #
############################################################################

# xtensor-fftw cmake module
# This module sets the following variables in your project::
#
#   xtensor-fftw_FOUND - true if xtensor-fftw found on the system
#   xtensor-fftw_INCLUDE_DIRS - the directory containing xtensor-fftw headers
#   xtensor-fftw_LIBRARY - empty

@PACKAGE_INIT@

if(FFTW_USE_FLOAT)
    add_definitions(-DXTENSOR_FFTW_USE_FLOAT)
endif()

if(FFTW_USE_DOUBLE)
    add_definitions(-DXTENSOR_FFTW_USE_DOUBLE)
endif()

if(FFTW_USE_LONG_DOUBLE AND NOT MSVC)
    add_definitions(-DXTENSOR_FFTW_USE_LONG_DOUBLE)
endif()

if(NOT FFTW_USE_FLOAT AND NOT FFTW_USE_DOUBLE AND NOT FFTW_USE_LONG_DOUBLE) 
    message(FATAL_ERROR "Please, select at least one of the available FFTW type libraries")
endif()

set(PN xtensor-fftw)
set_and_check(${PN}_INCLUDE_DIRS "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_INCLUDEDIR@")
set(${PN}_LIBRARY "")
check_required_components(${PN})
